package Level03_three;

public class Test {
    public static boolean prime(Integer a) {
        if (a == 0 || a == 1) {
            return false;
        }
        if (a == 2 ) {
            return true;
        }
        if (a % 2 == 0) {
            return false;
        }
        for (int i = 3; i * i < a; i += 2) {
            if (a % i == 0) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Integer count = 0;
        for (int i = 101; i <= 200; i++) {
            if (prime(i)) {
                System.out.print(i+" ");
                count++;
                if (count % 5 == 0) {
                    System.out.println(" ");

                }
            }
        }
    }

}
